function addListener(element,basename,handler) // Pour tester sur IE
{
	if(element.addEventListener)
	{
		element.addEventListener(basename,handler,false);
	}
	else
	{
		if (element.attachEvent)
		{
			element.attachEvent('on'+basename,handler);
		}
	}
}

function traiterListe(e)
{

	var requete = createXmlHttpRequestObject();
	//Recupere la valeur de l'elt selectionn� dans la liste
	var adherents = e.target.value;
	if (adherents != '')
	{
		var url = "afficher_adherents.php?archive="+adherents;
		requete.open("GET", url, true);
		requete.onreadystatechange = function(){afficherTableau(requete)};
		requete.send(null);
	}
}

/*function traiterBouton(e)
{
		window.location="ajout-maj_information.php?choix=add"
}*/

function afficherTableau(requete)
{
	if (requete.readyState==4 && (requete.status == 200 || requete.status == 0)) {
		document.body.style.cursor='default';
		var res = requete.responseText;
		document.getElementById("tab_adherents").innerHTML = res;
		
	}
	else
	{
		if (requete.readyState < 4) 
		{
			document.body.style.cursor='wait';
		}
	}
}

function charge()
{
	addListener(document.getElementById('liste_adhérents'),'change',traiterListe);
}


function stopEvent(e) {
	if(e.stopPropagation){
		e.stopPropagation();
		e.preventDefault();
	}
 
	if(window.event){
		window.event.cancelBubble = true;
		window.event.returnValue  = false;
		return;
	}
}


function checkForm(event)
{
	faulty=null;
	if(!faulty)
	{
		return stopEvent(event);
	}
 }


function addFormCheck()
{
	var form = document.getElementById('ajout_info');
	addListener(form,'submit',checkForm);
}

//addListener(window,'load',setSpan);

addListener(window,'load',charge);